﻿using System.Collections.Generic;

public class TKChessDun : BaseChess
{
    public TKChessDun(int camp, int team) : base(camp, team)
    {

    }
    public override void AddSomePosIntoList(BaseChessBoard chessBoard, List<Pos> tempPosList)
    {
        if (!(chessBoard is TK_ChessBoard))
        {
            return;
        }
        BaseGrid grid = chessBoard.GetGridByChess(this);
        if (grid != null)
        {
            Pos chessPos = grid.GetPos();
            Pos orientation1Pos = chessPos.AddResult(((TK_ChessBoard)chessBoard).GetOrientation1DirectionByCamp(GetCamp()));
            if (chessBoard.SpaceIsGridAndNotExistChess(orientation1Pos) || chessBoard.SpaceIsGridAndExistOtherTeamChess(orientation1Pos, GetTeam()))
            {
                tempPosList.Add(orientation1Pos);
            }
            Pos orientation2Pos = chessPos.AddResult(((TK_ChessBoard)chessBoard).GetOrientation2DirectionByCamp(GetCamp()));
            if (chessBoard.SpaceIsGridAndNotExistChess(orientation2Pos) || chessBoard.SpaceIsGridAndExistOtherTeamChess(orientation2Pos, GetTeam()))
            {
                tempPosList.Add(orientation2Pos);
            }
        }
    }

    public override Score GetScore(BaseChessBoard baseChessBoard)
    {
        TK_ChessBoard sChessBoard = baseChessBoard as TK_ChessBoard;
        if (sChessBoard == null)
        {
            return new Score(0, 0);
        }
        else
        {
            return new Score(2, 0);
        }
    }
}
